-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[CodeStyle][py2] remove the next
method for python2 compatibility (PEP 3114)
#47728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CodeStyle][py2] remove the next
method for python2 compatibility (PEP 3114)
#47728
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
next
method for python2 compatibility (PEP 3114)next
method for python2 compatibility (PEP 3114)
implementing iterator protocol of Python 2.x inside | ||
PaddlePaddle framework. | ||
''' | ||
return self.__next__() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next
method for python2 compatibility (PEP 3114)next
method for python2 compatibility (PEP 3114)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Others
PR changes
Others
Describe
Python2 里迭代器里要求包含
next
方法,而在 Python3 中则使用了__next__
方法取代了next
方法1,目前为了兼容 Python2,一些代码添加了next
方法,但只是调用了了一下__next__
,现在这个next
方法是没有必要的了Related links
Footnotes
PEP 3114 – Renaming
iterator.next()
toiterator.__next__()
↩